﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Frame.Lib.Core.Log;
using Frame.Lib.Core.Para;


namespace Frame.Lib.Core.Cache.Paras
{
    public class ParasLoader : CacheLoaderBase
    {
        public override void LoadData()
        {
            try
            {
                ParasContainer container = new ParasContainer();
                container.KeyValues = new System.Collections.Hashtable();


                ParaBO paras = new ParaBO();

                List<ParaInfo> list = paras.GetList();

                foreach (ParaInfo info in list)
                {
                    container.KeyValues.Add(info.ID, info.Value);
                }

                LoadComplete(container);
            }
            catch (Exception ex)
            {
                Logger.Exception(ex, "load Paras cache fail");
            }
            //throw new NotImplementedException();
        }
    }
}
